<%@ page import="com.gxuwz.leaveSystem.entity.User" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%--使用taglib 引入标签库--%>
<%--<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>--%>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="js/jquery.js"></script>
    <script src="js/pintuer.js"></script>
</head>
<body>
<form method="post" action="user_search" id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 用户信息列表</strong>
        </div>
        <div class="padding border-bottom">
            <ul class="search" style="padding-left:10px;">
                <li><a class="button border-main icon-plus-square-o" href="user_addView"> 添加</a></li>
                <li>搜索：</li>
                <li>
                    <input type="text" placeholder="请输入搜索关键字" name="keywords" class="input"
                           style="width:250px; line-height:17px;display:inline-block"/>
                    <button type="submit" href="javascript:void(0)" class="button border-main icon-search" > 搜索</button>
                </li>
            </ul>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th>工号</th>
                <th>姓名</th>
                <th>密码</th>
                <th>电话</th>
                <th>用户类型</th>
                <th>操作</th>
            </tr>
            <%
                List<User> users = (List<User>) request.getAttribute("users");
                if (users != null) {
                    for (User user : users) {
            %>
                <tr class="user-row">
                    <td width="100"><%= user.getUserid() %></td>
                    <td class="fullname"><%= user.getFullname() %></td>
                    <td class="password"><%= user.getPassword() %></td>
                    <td class="telephone"><%= user.getTelephone() %></td>
                    <td class="userType"><%= user.getUserType() %></td>
                    <td>
                        <div class="button-group">
                            <a class="button border-main" href="user_editView?id=<%= user.getUserid() %>"><span class="icon-edit"></span> 修改</a>
                            <a class="button border-red" href="user_delete?userid=<%= user.getUserid() %>"><span class="icon-trash-o"></span> 删除</a>
                        </div>
                    </td>
                </tr>
            <%
                    }
            }
                %>
        </table>
        <div class="pagelist"><a href="">上一页</a> <span class="current">1</span><a href="">2</a><a
                href="">3</a><a href="">下一页</a><a href="">尾页</a></div>
    </div>
</form>
<script>
<%--    JavaScript事件监听器，用于在用户点击ID为searchBtn的按钮时，自动提交ID为listform的表单。--%>
//     document.getElementById('searchBtn').addEventListener('click', function() {
//         document.getElementById('listform').submit();
//     });
</script>
</body>
</html>
